<?php

namespace Database\Factories;

use App\Models\ProductLog;
use Illuminate\Database\Eloquent\Factories\Factory;

class ProductLogFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = ProductLog::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'pay_user_id' => $this->faker->numberBetween(1, 19),
            'product_id' => $this->faker->numberBetween(1, 51),
            'user_id' => $this->faker->numberBetween(1, 10),
            'visit_num' => $this->faker->numberBetween(0, 50),
            'visitor_num' => $this->faker->numberBetween(0, 50),
            'cart_num' => $this->faker->numberBetween(0, 50),
            'order_num' => $this->faker->numberBetween(0, 50),
            'pay_num' => $this->faker->numberBetween(0, 50),
            'pay_price' => $this->faker->randomFloat(2, 0, 50),
            'cost_price' => $this->faker->randomFloat(2, 0, 50),
            'refund_num' => $this->faker->numberBetween(0, 100),
            'refund_price' => $this->faker->randomFloat(2, 0, 10),
            'collect_num' => $this->faker->numberBetween(0, 100),
            'margin' => $this->faker->randomFloat(2, 0, 50),
            'payment' => $this->faker->randomFloat(2, 0, 50),
            'created_at' => date('Y-m-d H:i:s',$this->faker->numberBetween(1632500000, time())),
            'updated_at' => date('Y-m-d H:i:s',$this->faker->numberBetween(1632500000, time())),
            'type' => $this->faker->numberBetween(0, 4),
        ];
    }
}
